<template>
  <div class="butt-list-sty">
    <div v-for="(item,index) in topitemSelectList" :key="item.itemTypeId" :class="index === itemtypeactive ? 'basebut1':'basebut2'" @click="itemtypeactive=index">
      {{ item.farmingTypeName }}
    </div>
  </div>
</template>
<script>
// import baseQuery from "@/api/digital-operation/base"
export default {
  data() {
    return {
      itemtypeactive: 0,
      topitemSelectList: [
        { farmingTypeNo: 2, farmingTypeName: "中止" },
        // { farmingTypeNo: 2, farmingTypeName: "中止合同" },
        { farmingTypeNo: 3, farmingTypeName: "终止" }
      ]
    }
  },
  watch: {
    itemtypeactive(newvalue) {
      this.selbut(newvalue)
    }
  },
  mounted() {
    this.selbut(0)
  },
  methods: {
    selbut(i) {
      this.$emit('topitemtype', this.topitemSelectList[i]['farmingTypeNo'])
    }
  }
}
</script>
<style lang="scss" scoped>
.butt-list-sty{
    // width: 100%;
    height: 35px;
    display: flex;
    // position: relative;
    // top: 50%;
    // transform: translateY(50%);
    flex-direction: row;
    padding: 0 25px;
}
.basebut1 {
    width: 80px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background-color: #15a0ca;
    // background-image: linear-gradient(#b0ebff,#97ddf7,#38cbf8);
    border: #f6f9f9 1px solid;
    // border-radius: 15px;
    color: #ffffff;
    cursor: pointer;
    margin: 3px 5px;
    // transform: translateY(50%);
}
.basebut2 {
    width: 80px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    // background-color: #106986;
    // border-radius: 15px;
    border: 1px solid #6ecae3;
    color: #ffffff;
    cursor: pointer;
    margin: 3px 5px;
    // padding-left: 10px;
    // padding-right: 10px;
    // transform: translateY(50%);
}
</style>
